/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package za.ac.cput.srp.srpcomplient.Impl;

import java.util.Calendar;
import za.ac.cput.srp.srpcomplient.GenerationCalculations;

/**
 *
 * @author given
 */
public class GenerationCalculationsImpl implements GenerationCalculations{
    private int yearEst;
    private int totalYrsEst;

    @Override
    public void setYearFamilyEstablished(int year) {
        yearEst = year;
    }
    
    @Override
    public void calculateNumberOfyrsSinceEst() {
        Calendar cal = Calendar.getInstance();
        totalYrsEst = cal.get(Calendar.YEAR) -  getYearEst();
    }
    
    @Override
    public int getTotalYrsEst() {
        return totalYrsEst;
    }

    @Override
    public int getYearEst() {
        return yearEst;
    }
}
